/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mumaker.spots;

import java.awt.Color;
import java.util.ArrayList;

/**
 *
 * @author Javs
 */
public class GestGrahSpot {
    
    private ArrayList<GraphSpots> arrGraphSpot = new ArrayList<GraphSpots>();
    private static GestGrahSpot INSTANCE = null;
    // Private constructor suppresses 

    private GestGrahSpot() {
       
    }

    // creador sincronizado para protegerse de posibles problemas  multi-hilo
    // otra prueba para evitar instanciación múltiple 
    private synchronized static void createInstance() {
        if (INSTANCE == null) {            
            INSTANCE = new GestGrahSpot();
        }
    }
    
    public static GestGrahSpot getInstance() {
        createInstance();
        return INSTANCE;
    }
    
    
    //  public GraphSpots(int x, int y, Color color, int radio, Mapa map) {
    public void cargarNuevoGraph(int x, int y, Color color, int radio, int mapa) {
        Mapa m = GestMapa.getInstance().retornarNroMapa(mapa);
        GraphSpots gs = new GraphSpots(x, y, color, radio, m);
        this.arrGraphSpot.add(gs);
    }   
    
    public ArrayList<GraphSpots> retornarGraphs(){
        return this.arrGraphSpot;
    }
    
}
